package com.itheima.exerciseTest.test50_59;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class Test59 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String username = sc.nextLine().trim();
        System.out.println("请输入密码：");
        String password = sc.nextLine().trim();

        FileWriter fw = null;
        try {
            fw = new FileWriter("backBurner\\d.txt");
            fw.write(username);
            fw.write("\r\n");
            fw.write(password);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fw != null) {
                try {
                    fw.flush();
                    fw.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
